import { Entity, PrimaryGeneratedColumn, Column, Index } from "typeorm";
import { ManualTimestamp } from "../decorators/manual-timestamp.decorator";

@Entity("character_sinew_claim")
@ManualTimestamp()
@Index(["characterId", "claimDate"], { unique: true })
export class CharacterSinewClaimEntity {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column("int", { name: "character_id" })
  characterId!: number;

  @Column("date", { name: "claim_date" })
  claimDate!: string; // YYYY-MM-DD

  @Column("datetime", { name: "created_at" })
  created_at!: Date;

  @Column("datetime", { name: "updated_at", nullable: true })
  updated_at!: Date | null;
}
